package core.domain.messages;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlRootElement;

import core.domain.Torrent;

@XmlRootElement
public class AvailabilityMessage extends AbstractMessage {
	private static final long serialVersionUID = 8012573121683878552L;

	protected AvailabilityMessage() {
		super(MessageType.AVAILABILITY);
	}

	public AvailabilityMessage(Torrent torrent){
		this();
		this.torrent = torrent;
		availableParts = new ArrayList<Integer>();
	}

	/**
	 * the torrent in question (the request)
	 */
	private Torrent torrent = null;
	
	/**
	 * available parts (the response)
	 */
	private List<Integer> availableParts;

	public Torrent getTorrent() {
		return torrent;
	}

	public void setTorrent(Torrent torrent) {
		this.torrent = torrent;
	}

	public List<Integer> getAvailableParts() {
		return availableParts;
	}

	public void setAvailableParts(List<Integer> availableParts) {
		this.availableParts = availableParts;
	}

	@Override
	public String toString() {
		return "AvailabilityMessage [torrent=" + torrent + ", availableParts=" + availableParts + "] super: " +super.toString() ;
	}
	
	
	
	
	
	
}
